<script setup>
// 现场回收盘点复核确认表
import { ref, reactive, defineExpose, defineEmits } from 'vue'
import {  orderlistApi } from '../../../api/index'
import { useRouter, useRoute } from 'vue-router'
const currentPage4 = ref(1)
const total = ref()
const velist = ref([])
const tabid = ref()
const tableheight = ref('600px')
const router = useRouter()
const data = reactive({
	limit: 20,
	page:1
})
const showload = function () {
    getlist()
}

// 获取订单列表	
const getlist = async function () {
	const msg = await orderlistApi(data)
	if (msg.data.code == 0) {
		velist.value = msg.data.data
		total.value = msg.data.total
	}
}

const handleCurrentChange = function (val) {
	data.page = val
	getlist()
}

const pushdeta = function (val) {
    router.push({path:'/order/orderdetails',query:{id:val}})
}
defineExpose({
    showload
})
</script>
<template>
    <div>
        <el-table :data="velist" border  style="width:100%;" :height="tableheight"  :cell-style="{height:'18px'}" :header-cell-style="{ height:'25px',color: '#818693',background:'#f3f4f7'}">
				<el-table-column label="Id"  width="40" fixed>
				<template #default="scope">
						<div style="font-size: 14px;">{{ scope.row.id }}</div>
				</template>
				</el-table-column>
				<el-table-column label="订单号" width="300">
				<template #default="scope">
						<div style="font-size: 14px;">{{ scope.row.orderId }}</div>
				</template>
				</el-table-column>
				<el-table-column label="数量"  width="80">
				<template #default="scope">
						<div style="font-size: 14px;">{{ scope.row.count }}</div>
				</template>
				</el-table-column>
				<el-table-column label="产品"  width="150">
				<template #default="scope">
						<div style="font-size: 14px;">{{ scope.row.title }}</div>
				</template>
				</el-table-column>
				<el-table-column label="企业"  width="100">
				<template #default="scope">
						<div style="font-size: 14px;">{{ scope.row.enterprise }}</div>
				</template>
				</el-table-column> 
				<el-table-column label="订单状态"  width="90">
				<template #default="scope">
						<div style="font-size: 14px;">{{ scope.row.orderStatus }}</div>
				</template>
				</el-table-column>
				<el-table-column label="无效状态"  width="90">
				<template #default="scope">
						<div style="font-size: 14px;">{{ scope.row.invalid?'无效':'有效' }}</div>
				</template>
				</el-table-column>
				<el-table-column label="完成状态"  width="90">
				<template #default="scope">
						<div style="font-size: 14px;">{{ scope.row.endBool?'已完成':'未完成' }}</div>
				</template>
				</el-table-column>            
				<el-table-column label="操作" width="100" fixed="right">
				<template #default="scope">
					<div style="color:#FCBE00;font-size: 14px;cursor: pointer;" @click="pushdeta(scope.row.id)">查看详情</div>
					<!-- <el-button key="warning" type="warning" @click="pushdeta(scope.row.id)" text>查看详情</el-button> -->
				</template>
				</el-table-column>
				<template v-slot:empty>
					<el-empty :image-size="130" description="" />
				</template>
			</el-table>
			<div style="display: flex;justify-content: center;align-content: center;margin-top: 10px;">
			<el-pagination
				v-model:current-page="currentPage2"
				v-model:page-size="pageSize2"
				:small="small"
				background
				:disabled="disabled"
				:background="background"
				layout="prev, pager, next"
				:total="total"
				@size-change="handleSizeChange"
				@current-change="handleCurrentChange"
				/>
			</div>
    </div>
</template>